home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / p063b9s.zip / UNIT / POPED.PAS < prev    next >
Pascal/Delphi Source File  |  1996-04-20  |  36KB  |  1,137 lines

  1. UNIT PopEd;
  2. {╔══════════════════════════════════════════════════════════════════════════╗}
  3. {║ Portal Msg-Editor                             Last changed: 20.04.96  SA ║}
  4. {║                                                                          ║}
  5. {║                         (C) Copyright 1989-94 by                         ║}
  6. {║       Dan Wulff, Jens Sandalgaard, Steen Christensen & S¢ren Ager        ║}
  7. {║                                                                          ║}
  8. {║ This source may not be given to anybody, without the written permission  ║}
  9. {║ from The Portal Team.                                                    ║}
  10. {╚══════════════════════════════════════════════════════════════════════════╝}
  11. {$I POPDEFS.Inc}
  12. INTERFACE
  13.  
  14. USES Use32;
  15.  
  16. PROCEDURE PopEdMain;
  17.  
  18. IMPLEMENTATION
  19.  
  20. USES
  21.   Dos,
  22.   PoPTypes, NetFile, Globals, RBrowser, OproUtil, Util, StrUtil, Resource,
  23.   LogFile, FileUtil, Nodelist,
  24.   OpString, OpEntry, OpBrowse, OpCmd, OpCrt, OpWindow, OpEditor, OpInline,
  25.   Oproot, OpSelect,
  26.   MKFile, MKMsgAbs, MkObject, MKGlobT;
  27.  
  28.  
  29. TYPE
  30.  
  31.      PPOPEDArea = ^TPOPEDArea;
  32.      TPOPEDArea = RECORD
  33.        Directory  : PathStr;           { QBBS/SBBS/RA=Board number, other=Directory path }
  34.        EchoNames  : ARRAY[1..3] Of S32;{ Echo mail tags }
  35.        Origin     : S50;               { Origin line, if any }
  36.        Pvt2EMail  : Boolean;
  37.        Description: S40;               { The title or description of this area }
  38.        AreaType   : Byte;              { 0=Hudson, 1=Msg 2=Squish 3=EzyCom 4=JAM}
  39.        UsedAka    : Byte;              { Which AKA address to use, 0=Main address }
  40.        NumMsg     : Word;
  41.        LastRead   : Word;
  42.      END;
  43.  
  44.      PPOPEDInfo = ^TPOPEDInfo;
  45.      TPOPEDInfo = RECORD
  46.        address                  : S20;
  47.        description              : S40;
  48.        echotag                  : S32;
  49.        originaladdress          : S20;
  50.        originaldate             : S10;
  51.        originalsubject          : S72;
  52.        originalsysopfirstname   : S35;
  53.        originalsysoplastname    : S35;
  54.        originalsysopname        : S35;
  55.        originaltime             : S5;
  56.        originaltoaddress        : S20;
  57.        originaltosysopfirstname : S35;
  58.        originaltosysoplastname  : S35;
  59.        originaltosysopname      : S35;
  60.        QuoteInitials            : S4;
  61.        subject                  : S72;
  62.        sysopfirstname           : S35;
  63.        sysoplastname            : S35;
  64.        sysopname                : S35;
  65.        toaddress                : S20;
  66.        tosysopfirstname         : S35;
  67.        tosysoplastname          : S35;
  68.        tosysopname              : S35;
  69.        EditorStartLine          : Integer;
  70.      END;
  71.  
  72.      MyBrowserPtr = ^MyBrowser;
  73.      MyBrowser = Object(Browser)
  74.        procedure brDrawLine(Y : Byte); virtual; {!!.03}
  75.      END;
  76.  
  77.      MyEditorPtr = ^MyEditor;
  78.      MyEditor = Object(TextEditor)
  79.        procedure meDrawLine(St : String; LineNum : Integer); Virtual;
  80.      END;
  81.  
  82. Const
  83.   StLen = 81;
  84.   TmpName = '$POPED$.MSG';
  85.   TmpName2 = '$POPED$.ARE';
  86.   TmpName3 = '$POPED$.TMP';
  87.  
  88. Var
  89.   Save      : Boolean;
  90.   f         : File;
  91.   ff        : File;
  92.   Msg       : AbsMsgPtr;
  93.   MsgNumber : LongInt;
  94.   BrowseWin : MyBrowserPtr;
  95.   EditorWin : MyEditorPtr;
  96.   Status    : Integer;
  97.   Finished  : Boolean;
  98.   HeaderWin : WindowPtr;
  99.   POPEDArea : PPOPEDArea;
  100.   POPEDInfo : PPOPEDInfo;
  101.   EditorLineNumber : Integer;
  102.  
  103.   procedure InsertHex(var Dest; Ch : Char);
  104.     {-Convert Ch to hex and store in Dest}
  105.   inline(
  106.     $58/                   {pop ax       ;char into al}
  107.     $5F/                   {pop di       ;es:di => dest}
  108.     $07/                   {pop es}
  109.     $88/$C4/               {mov ah,al    ;ah = al}
  110.     $80/$E4/$0F/           {and ah,$0f   ;ah has low nibble}
  111.     $80/$FC/$0A/           {cmp ah,$0a   ;ah >= $a?}
  112.     $72/$05/               {jb x1}
  113.     $80/$C4/$37/           {add ah,'A'-$a}
  114.     $EB/$03/               {jmp short x2}
  115.                            {x1:}
  116.     $80/$C4/$30/           {add ah,'0'}
  117.                            {x2:}
  118.     $B1/$04/               {mov cl,4     ;al has high nibble}
  119.     $D2/$E8/               {shr al,cl}
  120.     $3C/$0A/               {cmp al,$0a   ;al >= $a?}
  121.     $72/$04/               {jb x3}
  122.     $04/$37/               {add al,'A'-$a}
  123.     $EB/$02/               {jmp short x4}
  124.                            {x3:}
  125.     $04/$30/               {add al,'0'}
  126.                            {x4:}
  127.     $AB);                  {stosw        ;store it}
  128.  
  129.  
  130.   procedure MyBrowser.brDrawLine(Y : Byte);
  131.     {-Draw working line to row Y of screen}
  132.   label
  133.     EndLoop, EndHexLoop, NormalChar;
  134.   var
  135.     X : Integer;
  136.     XTab : Integer;
  137.     XRight : Integer;
  138.     MNum : Word;
  139.     Attr : Byte;
  140.     SLine : String;
  141.     SRec : record                 {Record used to shift string right by one}
  142.              SLen : Byte;
  143.              ShStr : String;
  144.            end absolute SLine;
  145.     HexSt : string[8];
  146.     Col1, Col2 : Word;
  147.     Count : Word;
  148.     ColOfs : Word;
  149.     LastPos : LongInt;
  150.     WinWidth : Word;
  151.     {$IFDEF UseMouse}
  152.     SaveMouse : Boolean;
  153.     {$ENDIF}
  154.   begin
  155.     {Check for markers}
  156.     MNum := $FFFF;
  157.     for X := 0 to MaxMarker do
  158.       if brMarkers[X].FilePos = WorkPos then
  159.         MNum := X;
  160.  
  161.     {Select attribute for line}
  162.     if WorkPos = brFndPos then
  163.       Attr := ColorMono(brHighlightColor, brHighlightMono)
  164.     else if brBlockOn and (WorkPos >= brBlkBegin.FilePos) and (WorkPos < brBlkEnd.FilePos) then
  165.       Attr := ColorMono(brBlockColor, brBlockMono)
  166.     else
  167.       Attr := ColorMono(wTextColor, wTextMono);
  168.  
  169.     {are we in hex mode?}
  170.     ColOfs := brColOfs;
  171.     LastPos := brLastPos;
  172.     WinWidth := brWinWidth;
  173.     if FlagIsSet(brOptions, brHexMode) then begin
  174.       {Initialize screen line}                             {!!.03}
  175.       if brHex8 then                                       {!!.03}
  176.         SRec.SLen := Hex8Width                             {!!.03}
  177.       else                                                 {!!.03}
  178.         SRec.SLen := Hex16Width;                           {!!.03}
  179.  
  180.       {skip all this if we're past end-of-file}
  181.       if (WorkPos > LastPos) or (brColOfs >= SRec.SLen) then begin {!!.03}
  182.         SRec.SLen := 0;
  183.         goto EndHexLoop;
  184.       end;
  185.  
  186.       FillChar(SLine[1], SRec.SLen, ' ');
  187.  
  188.       {plug in file offset and initialize}
  189.       HexSt := HexL(WorkPos);
  190.       if SRec.SLen = Hex8Width then begin
  191.         Col1 := 8;
  192.         Col2 := Hex8Width-7;
  193.         Count := 8;
  194.         MoveFast(HexSt[4], SLine[1], 5); {!!.01}
  195.       end
  196.       else begin
  197.         Col1 := 10;
  198.         Col2 := Hex16Width-15;
  199.         Count := 16;
  200.         MoveFast(HexSt[3], SLine[1], 6); {!!.01}
  201.       end;
  202.  
  203.       for X := 1 to Count do
  204.         {do nothing if beyond end of file}
  205.         if WorkPos <= LastPos then begin
  206.           {get next character}
  207.           if (WorkOfs >= WorkEnd) then
  208.             brGetWorkingChar
  209.           else
  210.             Byte(WorkChr) := Byte(WorkPtr^) and brMask;
  211.  
  212.           {plug everything in}
  213.           InsertHex(SLine[Col1], WorkPtr^);
  214.           if brMask = $FF then
  215.             SLine[Col2] := WorkChr
  216.           else case WorkChr of
  217.             ' '..'~' :
  218.               SLine[Col2] := WorkChr
  219.             else
  220.               SLine[Col2] := '.';
  221.           end;
  222.  
  223.           {advance counters}
  224.           Inc(Col1, 3);
  225.           Inc(Col2, 1);
  226.           Inc(WorkPos);
  227.           Inc(WorkOfs);
  228.         end;
  229.  
  230.       {if we're scrolled, shift text to the left}
  231.       if (ColOfs >= WinWidth) then
  232.         SRec.SLen := 0
  233.       else if (ColOfs > 0) then begin
  234.         MoveFast(SLine[ColOfs+1], SLine[1], SRec.SLen-ColOfs); {!!.01}
  235.         Dec(SRec.SLen, ColOfs);
  236.       end;
  237.  
  238. EndHexLoop:
  239.       {pad end of line with blanks}
  240.       if WinWidth > SRec.SLen then
  241.         FillChar(SLine[SRec.SLen+1], WinWidth-SRec.SLen, ' ');
  242.       SRec.SLen := WinWidth;
  243.     end
  244.     else begin
  245.       {Initialize screen line}
  246.       SRec.SLen := WinWidth;
  247.       FillChar(SLine[1], WinWidth, ' ');
  248.  
  249.       {skip all this if we're past end-of-file}
  250.       if WorkPos > LastPos then
  251.         goto EndLoop;
  252.  
  253.       X := 1;
  254.       XRight := ColOfs+WinWidth;
  255.       while X <= XRight do begin
  256.         if WorkPos > LastPos then begin
  257.           {Past end of file}
  258.           if X > ColOfs then
  259.             {Transfer character to line buffer}
  260.             SLine[X-ColOfs] := ' ';
  261.           Inc(X);
  262.         end
  263.         else begin
  264.           if (WorkOfs >= WorkEnd) then
  265.             brGetWorkingChar
  266.           else
  267.             Byte(WorkChr) := Byte(WorkPtr^) and brMask;
  268.           case WorkChr of
  269.             ^M :                  {End of line}
  270.               goto EndLoop;
  271.             ^I :                  {Expand tabs}
  272.               if FlagIsSet(brOptions, brTabExpand) then begin
  273.                 XTab := ((X+7) and $FFF8)+1; {!!.13}
  274.                 if XTab > XRight then
  275.                   XTab := XRight;
  276.                 while X < XTab do begin
  277.                   if X > ColOfs then
  278.                     SLine[X-ColOfs] := ' ';
  279.                   Inc(X);
  280.                 end;
  281.                 Inc(WorkPos);
  282.                 Inc(WorkOfs);
  283.               end
  284.               else
  285.                 goto NormalChar;
  286.             else begin
  287. NormalChar:
  288.               if X > ColOfs then begin
  289.                 if (WorkChr = ^Z) then
  290.                   WorkChr := ' ';
  291.                 {Transfer character to line buffer}
  292.                 SLine[X-ColOfs] := WorkChr;
  293.               end;
  294.               Inc(X);
  295.               Inc(WorkPos);
  296.               Inc(WorkOfs);
  297.             end;
  298.           end;
  299.         end;
  300.       end;
  301.     end;
  302.  
  303. EndLoop:
  304.     {$IFDEF UseMouse}
  305.     HideMousePrim(SaveMouse);
  306.     {$ENDIF}
  307.  
  308.     {Write line buffer to screen}
  309.  
  310.     If Pos('>',Copy(Sline,1,10))<> 0 then
  311.       Attr := ColorMono(brHighlightColor, brHighlightMono);
  312.     If (Sline[1]=#1) or (Copy(Sline,1,8)='SEEN-BY:') then
  313.       Attr := ColorMono(brBlockColor, brBlockMono);
  314.  
  315.     if MNum <> $FFFF then begin
  316.       {Put mark at left edge}
  317.       FastWrite(Char(Ord('0')+MNum), Y, wXL, ColorMono(brMarkerColor, brMarkerMono));
  318.       SRec.ShStr[0] := Char(WinWidth-1);
  319.       FastWrite(SRec.ShStr, Y, wXL+1, Attr);
  320.     end
  321.     else
  322.       FastWrite(SLine, Y, wXL, Attr);
  323.  
  324.     {$IFDEF UseMouse}
  325.     ShowMousePrim(SaveMouse);
  326.     {$ENDIF}
  327.   end;
  328.  
  329.  
  330.   procedure MyEditor.meDrawLine(St : String; LineNum : Integer);
  331.     {-Draw the specified line}
  332.   var
  333.     StLen : Byte absolute St;
  334.     SearchLen : Byte absolute teSearchSt;
  335.     ASt : string;
  336.     AStLen : Byte absolute ASt;
  337.     TA, CA, BA, MA, HA : Byte;
  338.     I, J : Word;
  339.     BLine, ELine : Integer;
  340.     BCol, ECol : Byte;
  341.   begin
  342.     {pad character string}
  343.     J := MaxWord(Word(meWinWidth)+meColDelta, 255);
  344.     FillChar(St[Succ(StLen)], J-StLen, ' ');
  345.  
  346.     {initialize attribute string}
  347.     TA := ColorMono(wTextColor, wTextMono);
  348.     FillChar(ASt[1], J, TA);
  349.     AStLen := J;
  350.  
  351.     {map control characters}
  352.     if (StLen > 0) and LongFlagIsSet(meOptions, teMapCtrls) then begin
  353.       CA := ColorMono(meCtrlColor, meCtrlMono);
  354.       for I := meColDelta+1 to StLen do
  355.         if St[I] < ' ' then begin
  356.           Inc(Byte(St[I]), 64);
  357.           ASt[I] := Char(CA);
  358.         end;
  359.     end;
  360.  
  361.     {account for block markers}
  362.     if LongFlagIsSet(meOptions, teBlockOn) then begin
  363.       BLine := teBlkBegin.Line;
  364.       ELine := teBlkEnd.Line;
  365.       if teBlkBegin.Col > J then
  366.         BCol := J
  367.       else
  368.         BCol := teBlkBegin.Col;
  369.       if teBlkEnd.Col > J then
  370.         ECol := J
  371.       else
  372.         ECol := teBlkEnd.Col;
  373.       BA := ColorMono(teBlockColor, teBlockMono);
  374.       if (LineNum >= BLine) and (LineNum <= ELine) then
  375.         {is this the first line of the block?}
  376.         if (LineNum = BLine) then
  377.           {is this also the last line of the block?}
  378.           if (LineNum = ELine) then
  379.             {entire block is within this one line}
  380.             FillChar(ASt[BCol], ECol-BCol, BA)
  381.           else
  382.             {first line of block}
  383.             FillChar(ASt[BCol], Succ(J-BCol), BA)
  384.         {is this the last line of the block?}
  385.         else if (LineNum = ELine) then
  386.           {first part of line is inside the block}
  387.           FillChar(ASt[1], ECol-1, BA)
  388.         else
  389.           {line is completely within the block}
  390.           FillChar(ASt[1], J, BA);
  391.     end;
  392.  
  393.     {account for text markers}
  394.     if LongFlagIsSet(meOptions, teMarkersOn) and (teMarkerFlags <> 0) then begin
  395.       MA := ColorMono(teMarkerColor, teMarkerMono);
  396.       for I := 0 to MaxMarker do
  397.         with teMarkers[I] do
  398.           if LineNum = Line then begin
  399.             St[Col] := Char(Ord('0')+I);
  400.             ASt[Col] := Char(MA);
  401.           end;
  402.     end;
  403.  
  404.     {highlight string at cursor?}
  405.     if (LineNum = meCurLine) and LongFlagIsSet(meOptions, teHighlightOn) then begin
  406.       HA := ColorMono(teHighlightColor, teHighlightMono);
  407.       I := meCurCol;
  408.       if not LongFlagIsSet(meOptions, teHighlightBack) then
  409.         Dec(I, Pred(SearchLen));
  410.       FillChar(ASt[I], SearchLen, HA);
  411.     end;
  412.  
  413.     {adjust for ColDelta}
  414.     I := meColDelta+1;
  415.     if (I > 1) then begin
  416.       MoveFast(St[I], St[1], meWinWidth);  {!!.01}
  417.       MoveFast(ASt[I], ASt[1], meWinWidth);  {!!.01}
  418.     end;
  419.  
  420.     {set the length bytes}
  421.     StLen := meWinWidth;
  422.     AStLen := StLen;
  423.  
  424.     If Pos('>',Copy(St,1,10))<> 0 then
  425.       FillChar(ASt,AStLen, ColorMono(teHighlightColor, teHighlightMono));
  426.     If (St[1]=#1) or (Copy(St,1,8)='SEEN-BY:') then
  427.       FillChar(ASt,AStLen, ColorMono(teBlockColor, teBlockMono));
  428.  
  429.     {draw the string}
  430.     FastWriteAttr(St, Word(wYL)+(LineNum-meLineAtTop), wXL, ASt)
  431.   end;
  432.  
  433.  
  434.  
  435. (*****************************************************************************)
  436.  
  437.   Procedure ProcessInfoRec;
  438.   VAR
  439.     s : String;
  440.   BEGIN
  441.     PopEdInfo^.QuoteInitials:='';
  442.     s := POPEDInfo^.SysopName;
  443.     PopEdInfo^.SysOpFirstName := NextWord(' ',s);
  444.     PopEdInfo^.SysOpLastName := '';
  445.     While s <> '' do
  446.       PopEdInfo^.SysOpLastName := NextWord(' ',s);
  447.     s := POPEDInfo^.ToSysopName;
  448.     PopEdInfo^.ToSysOpFirstName := NextWord(' ',s);
  449.     PopEdInfo^.ToSysOpLastName := '';
  450.     While s <> '' do
  451.     BEGIN
  452.       PopEdInfo^.ToSysOpLastName := NextWord(' ',s);
  453.     END;
  454.     s:=PopEdInfo^.OriginalSysOpName;
  455.     PopEdInfo^.QuoteInitials:=copy(NextWord(' ',s),1,1);
  456.     While s <> '' do
  457.       PopEdInfo^.QuoteInitials:=PopEdInfo^.QuoteInitials+copy(NextWord(' ',s),1,1);
  458.   END;
  459.  
  460.   Procedure ProcessTemplate(MsgMode:Byte);
  461.   Var
  462.     t,
  463.     tt : PbufTextFile;
  464.     s  : String;
  465.  
  466.     Procedure DoQuotes;
  467.     Var
  468.       tOld : Text;
  469.       STmp,
  470.       STmpOut,
  471.       StmpRest : String;
  472.       QuotePos : Byte;
  473.     BEGIN
  474.       ProcessInfoRec;
  475.       Assign(tOld,Startpath+TmpName);
  476.       Reset(TOld);
  477.       STmpRest:='';
  478.       While not EOF(tOld) do
  479.       BEGIN
  480.         ReadLn(tOld,STmp);
  481.         If Trim(STmpRest)<>'' then STmpRest:=Trim(STmpRest)+' ' ELSE STmpRest:='';
  482.         QuotePos:= Pos('>',Copy(Stmp,1,10));    {Skal laves om, så den giver sidste pos!!!}
  483.         If QuotePos<> 0 then
  484.         BEGIN
  485.           Insert('>',STmp,QuotePos);
  486.           If STmpRest <> '' then
  487.           BEGIN
  488.             Insert(STmpRest,STmp,QuotePos+2);
  489.           END;
  490.           WordWrap(' ' + Trim(STmp) , STmpOut,STmpRest,78,False);
  491.         END ELSE
  492.         BEGIN
  493.           If Trim(STmp + STmpRest)<>'' then
  494.             WordWrap(' ' + Trim(PopEdInfo^.QuoteInitials + '> ' + STmpRest + STmp) , STmpOut,STmpRest,78,False)
  495.           ELSE
  496.             StmpOut:='';
  497.         END;
  498.         tt^.WriteLn(sTmpOut);
  499.         Inc(EditorLineNumber);
  500.       END;
  501.       Close(tOld);
  502.     END;
  503.  
  504.     Function CheckForKeyWord(var sss:String; skey:String; md1,md2:byte):Boolean;
  505.     Var
  506.      sssTmp : String;
  507.     BEGIN
  508.       CheckForKeyWord:=True;
  509.       If copy(sss,1,length(skey)) = skey then
  510.       BEGIN
  511.         Delete(sss,1,length(skey));
  512.         If md1<>md2 then
  513.         BEGIN
  514.           CheckForKeyWord:=False;
  515.         END;
  516.       END;
  517.     END;
  518.  
  519.     Function UseThisLine(Var ss:String; md:Byte):Boolean;
  520.     Var
  521.       UseThis : Boolean;
  522.     BEGIN
  523.       If copy(ss,1,1) = ';' then
  524.       BEGIN
  525.         UseThisLine := false;
  526.         exit;
  527.       END;
  528.       If copy(ss,1,1) = '$' then
  529.       BEGIN
  530.         If not CheckForKeyWord(ss,'$position',0,1) then
  531.         BEGIN
  532.           UseThisLine:=False;
  533.           POPEDInfo^.EditorStartLine:=EditorLineNumber;
  534.           Exit;
  535.         END;
  536.         If copy(ss,1,7) = '$quotes' then
  537.         BEGIN
  538.           Delete(ss,1,7);
  539.           If md=5 then
  540.           BEGIN
  541.             UseThisLine:=False;
  542.             DoQuotes;
  543.           END;
  544.         END;
  545. (*      If not CheckForKeyWord(ss,'$quotes',5,md) then
  546.         BEGIN
  547.           UseThisLine:=False;
  548.           DoQuotes;
  549.         END;
  550. *)
  551.         UseThis := CheckForKeyWord(ss,'$new',0,md);
  552.         If UseThis then UseThis := CheckForKeyWord(ss,'$changed',1,md);
  553.         If UseThis then UseThis := CheckForKeyWord(ss,'$comment',2,md);
  554.         If UseThis then UseThis := CheckForKeyWord(ss,'$forward',3,md);
  555.         If UseThis then UseThis := CheckForKeyWord(ss,'$moved',4,md);
  556.         If UseThis then UseThis := CheckForKeyWord(ss,'$quoted',5,md);
  557.         If UseThis then UseThis := CheckForKeyWord(ss,'$reply',6,md);
  558.         UseThisLine := UseThis;
  559.       END ELSE
  560.         UseThisLine:=True;
  561.     END;
  562.  
  563.   BEGIN
  564.     ProcessInfoRec;
  565.     New(t,INIT(Startpath+PopTemplateFileName,SOpenRead+ShareDenyW,2048));
  566.     New(tt,INIT(Startpath+TmpName3,SCreate,2048));
  567.     EditorLineNumber:=0;
  568.     POPEDInfo^.EditorStartLine:=1;
  569.     if t=NIL then exit;
  570.     if tt=nil then exit;
  571.     s:='';
  572.     While (not t^.eof) and (s<>'/POPED') do
  573.       t^.ReadLn(s);
  574.     If t^.eof then exit;        {----------------------------------}
  575.     t^.ReadLn(s);
  576.     While (not t^.eof) and (s<> '/') do
  577.     BEGIN
  578.       If UseThisLine(s,MsgMode) then   {UseThisLine also cuts prefixkeyword}
  579.       BEGIN
  580.         Case MsgMode of
  581.         0,1,2,3,4,5,6 : BEGIN
  582.                           Replace(s,'$address',PopedInfo^.Address,99);
  583.                           Replace(s,'$sysopname',PopedInfo^.SysOpName,99);
  584.                           Replace(s,'$sysopfirstname',PopedInfo^.SysopFirstName,99);
  585.                           Replace(s,'$sysoplastname',PopedInfo^.SysopLastName,99);
  586.                           Replace(s,'$tosysopname',PopedInfo^.ToSysopName,99);
  587.                           Replace(s,'$tosysopfirstname',PopedInfo^.ToSysopFirstName,99);
  588.                           Replace(s,'$tosysoplastname',PopedInfo^.ToSysopLastName,99);
  589.                         END;
  590.         END;
  591.         tt^.WriteLn(s);
  592.         Inc(EditorLineNumber);
  593.       END;
  594.       t^.ReadLn(s);
  595.     END;
  596.     tt^.WriteLn('--- PoPEd '+ver);
  597.     tt^.WriteLn(' * Origin: '+PopedArea^.Origin + ' ('+ PopEdInfo^.address + ')' );
  598.     Dispose(tt,Done);
  599.     Dispose(t,Done);
  600. {   Assign(f,Startpath+TmpName3);
  601.     Rename(f,Startpath+TmpName); }
  602.   END;
  603. (*
  604.                            0  1        2        3        4      5       6
  605.  
  606.                          $new $changed $comment $forward $moved $quoted $reply
  607. ------------------------------------------------------------------------------
  608. $address                 √ x  x        x        x        x      x       x
  609. $curdate                   x  x        x        x        x      x       x
  610. $curtime                   x  x        x        x        x      x       x
  611. $description               x  x        x        x        x      x       x
  612. $echotag                   x  x        x        x        x      x       x
  613. $message                      x        x        x        x      x       x
  614. $originaladdress                       x        x               x       x
  615. $originaldate                          x        x               x       x
  616. $originalsubject                       x        x               x       x
  617. $originalsysopfirstname                x        x               x       x
  618. $originalsysoplastname                 x        x               x       x
  619. $originalsysopname                     x        x               x       x
  620. $originaltime                          x        x               x       x
  621. $originaltoaddress                     x        x               x       x
  622. $originaltosysopfirstname              x        x               x       x
  623. $originaltosysoplastname               x        x               x       x
  624. $originaltosysopname                   x        x               x       x
  625. $quotes                                x                        x
  626. $sysopfirstname            x  x        x        x        x      x       x
  627. $sysoplastname             x  x        x        x        x      x       x
  628. $sysopname               √ x  x        x        x        x      x       x
  629. $toaddress                 x  x        x        x               x       x
  630. $tosysopfirstname          x  x        x        x               x       x
  631. $tosysoplastname           x  x        x        x               x       x
  632. $tosysopname               x  x        x        x               x       x
  633.  
  634. $fromaddress
  635. $fromsysopfirstname
  636. $fromsysoplastname
  637. $fromsysopname
  638.  
  639. $new      0
  640. $changed  1
  641. $comment  2
  642. $forward  3
  643. $moved    4
  644. $quoted   5
  645. $reply    6
  646.  
  647. $position
  648.  
  649. *)
  650.   Procedure SaveMessage;
  651.   Var
  652.     t      : Text;
  653.     TmpStr : String;
  654.     TmpAdr : TFidoAddress;
  655.   BEGIN
  656.     Assign(t,TmpName3);
  657.     Reset(t);
  658.     Msg^.StartNewMsg;
  659.     Msg^.SetFrom(PopedInfo^.SysopName);
  660.     Msg^.SetTo(PopedInfo^.ToSysopName);
  661.     Msg^.SetSubj(PopedInfo^.Subject);
  662.     Msg^.SetDate(DateStr(GetDosDate));
  663.     Msg^.SetTime(TimeStr(GetDosDate));
  664.     Msg^.SetLocal(True);
  665.     ParseAddr(PopEdInfo^.Address,TmpAdr,TmpAdr);
  666.     Msg^.SetOrig(TmpAdr);
  667.     ParseAddr(PopEdInfo^.ToAddress,TmpAdr,TmpAdr);
  668.     Msg^.SetDest(TmpAdr);
  669.     ReadLn(t,TmpStr);
  670.     Msg^.DoStringLn(TmpStr);
  671.     While (Not eof(t)) do
  672.     BEGIN
  673.       ReadLn(t,TmpStr);
  674.       Msg^.DoStringLn(TmpStr);
  675.     END;
  676.     Close(t);
  677.     Msg^.WriteMsg;
  678.   END;
  679.  
  680.   Procedure EditHeader;
  681.   VAR
  682.     ESR : PpopEntryScreen;
  683.     Up  : Pointer;
  684.     Offset : Byte;
  685.   BEGIN
  686.     NEW(ESR);
  687.     GetEsr(EsrPopedHeader,2,ESR^);
  688.     ESR^.UpdateScreenSize;
  689.     Offset:=(ScreenWidth-80) DIV 2;
  690.     ESR^.AdjustWindow(2+Offset,2,79+Offset,5);
  691.     ESR^.SetWrapMode(ExitAtBot);
  692.     up:=ESR^.GetUserRecord;
  693.     FillChar(up^,Sizeof(tPopedHeader),0);
  694.     TpopedHeader(up^).FromName:=cfg.sysop;
  695.     TpopedHeader(up^).ToName:=PopEdInfo^.OriginalSysopName;
  696.     TpopedHeader(up^).Subj:=PopEdInfo^.OriginalSubject;
  697.     TpopedHeader(up^).ToAddr:=PopEdInfo^.OriginalAddress;
  698.     If PopedArea^.UsedAKA = 0 then
  699.       TpopedHeader(up^).FromAddr:=Address2Str(Cfg.addresses[cfg.MainAdrNum])
  700.     ELSE
  701.       TpopedHeader(up^).FromAddr:=Address2Str(Cfg.addresses[POPEDArea^.UsedAKA]);
  702.     Esr^.Process;
  703.     PopedInfo^.SysopName := TpopedHeader(up^).FromName;
  704.     PopedInfo^.Address := TpopedHeader(up^).FromAddr;
  705.     PopedInfo^.ToSysopName := TpopedHeader(up^).ToName;
  706.     PopedInfo^.ToAddress := TpopedHeader(up^).ToAddr;
  707.     PopedInfo^.Subject := TpopedHeader(up^).Subj;
  708.     Dispose(Esr,Done);
  709.   END;
  710.  
  711.   Procedure EditMessage;
  712.   Var
  713.     TeSize : LongInt;
  714.   BEGIN
  715.     TeSize:=16000;
  716.     New(EditorWin, InitCustom(1,7,ScreenWidth,ScreenHeight,Cfg.Color[3],DefWindowOptions,TeSize));
  717.     If EditorWin=Nil then
  718.     BEGIN
  719.       AskError(8,'Could not open Editor:'+Long2Str(Maxavail),4);
  720.       Exit;
  721.     end;
  722.     EditorWin^.SetMaxLength(80);
  723.     EditorCommands.AddCommand(ccQuit, 1, Word(283), 0);        {Esc}
  724.     EditorCommands.AddCommand(ccUser11, 1, Word(11520), 0);    {Alt-X}
  725.     EditorWin^.ReadFile(TmpName3, TeSize);
  726.     EditorWin^.Draw;
  727.     EditorWin^.GotoLineCol(POPEDInfo^.EditorStartLine,1);
  728.     EditorWin^.ProcessSelf;
  729.     IF EditorWin^.GetLastCommand = ccQuit THEN EditorWin^.SaveFile;
  730.     EditorWin^.Erase;
  731.     Dispose(EditorWin,Done);
  732.   END;
  733.  
  734.   Function MsgFlags2Str:String;
  735.   Var
  736.     TmpStr : String;
  737.   BEGIN
  738.     TmpStr:='';
  739.     If Msg^.IsLocal Then TmpStr:=TmpStr+'Loc ';
  740.     If Msg^.IsCrash Then TmpStr:=TmpStr+'Cra ';
  741.     If Msg^.IsKillSent Then TmpStr:=TmpStr+'K/S ';
  742.     If Msg^.IsSent Then TmpStr:=TmpStr+'Snt ';
  743.     If Msg^.IsFAttach Then TmpStr:=TmpStr+'Att ';
  744.     If Msg^.IsReqRct Then TmpStr:=TmpStr+'RRq ';
  745.     If Msg^.IsReqAud Then TmpStr:=TmpStr+'ARq ';
  746.     If Msg^.IsRetRct Then TmpStr:=TmpStr+'RRc ';
  747.     If Msg^.IsFileReq Then TmpStr:=TmpStr+'Frq ';
  748.     If Msg^.IsRcvd Then TmpStr:=TmpStr+'Rcv ';
  749.     If Msg^.IsPriv Then TmpStr:=TmpStr+'Pvt ';
  750.     If Msg^.IsDeleted Then TmpStr:=TmpStr+'Del ';
  751. {   If Msg^.IsEchoed Then TmpStr:=TmpStr+'Ech '; }
  752.     MsgFlags2Str := TmpStr;
  753.   END;
  754.  
  755.   PROCEDURE ShowHeader;
  756.   Var
  757.     TmpStr : String;
  758.     TmpAdr : TFidoAddress;
  759.   BEGIN
  760.     TmpStr :='#'+Long2Str(Msg^.GetMsgNum)+' ['+Long2Str(Msg^.GetMsgDisplayNum);
  761.     TMpStr :=TmpStr+' of '+Long2Str(Msg^.NumberOfMsgs)+']  ';
  762.     If Msg^.GetRefer <> 0 then
  763.       TmpStr:=TmpStr+'-'+Long2Str(Msg^.GetRefer)+' ';
  764.     If Msg^.GetSeeAlso <> 0 then
  765.       TmpStr:=TmpStr+'+'+Long2Str(Msg^.GetSeeAlso);
  766.     TmpStr:=Pad(TmpStr,35);
  767.     HeaderWin^.wFasttext('Msg  : '+TmpStr,1,2);
  768.     HeaderWin^.wFasttext(Pad(MsgFlags2Str,35),1,45);
  769.     HeaderWin^.wFasttext('From : '+pad(Msg^.GetFrom,35),2,2);
  770.     HeaderWin^.wFasttext('To   : '+pad(Msg^.GetTo,35),3,2);
  771.     HeaderWin^.wFasttext('Subj.: '+pad(Msg^.GetSubj,72),4,2);
  772.     Msg^.GetOrig(TmpAdr);
  773.     HeaderWin^.wFasttext(Pad(Address2Str(TmpAdr),20),2,45);
  774.     Msg^.GetDest(TmpAdr);
  775.     HeaderWin^.wFasttext(Pad(Address2Str(TmpAdr),20),3,45);
  776.     HeaderWin^.wFasttext(Msg^.GetDate+' '+Msg^.GetTime,2,65);
  777. {   HeaderWin^.wFasttext(Long2Str(StackPos)+'   ',2,65); }
  778.   END;
  779.  
  780.   Function Browse(s:String): LongInt;
  781.   BEGIN
  782.     BrowseWin^.OpenFile(s);
  783.     Status := BrowseWin^.GetLastError;
  784.     if Status <> 0 then begin
  785. {      ErrorProc(0,InitStatus,'Failed to load File'); }
  786.       Exit;
  787.     end;
  788.     {use built-in status routine}
  789. {   BrowseWin^.SetErrorProc(ErrorProc); }
  790.     Finished := False;
  791.     repeat
  792.       BrowseWin^.Process;
  793.       case BrowseWin^.GetLastCommand of
  794.         ccQuit, ccError,
  795.         ccUser1, ccUser2,
  796.         ccUser3, ccUser4,
  797.         ccUser5, ccUser6,
  798.         ccUser7, ccUser8
  799.         : Finished := True;
  800.         {...user exit commands...}
  801.       end;
  802.     until Finished;
  803.     BrowseWin^.CloseFile;
  804.     Browse:=BrowseWin^.GetLastCommand;
  805.   END;
  806.  
  807.   Procedure Dump2File;
  808.   Var
  809.     t      : PBufTextFile;
  810.     TmpStr : String;
  811.   BEGIN
  812.     New(t, Init(TmpName, SCreate, 2048));
  813.     Msg^.MsgTxtStartUp;
  814.     t^.WriteLn(Msg^.GetString(StLen));
  815.     While (Not Msg^.EOM) do
  816.     BEGIN
  817.       t^.WriteLn(Msg^.GetString(StLen));
  818.     END;
  819.     Dispose(t,Done);
  820.   END;
  821.  
  822.   Procedure BrowseDispose;
  823.   BEGIN
  824.     BrowseWin^.Erase;
  825.     Dispose(BrowseWin,Done);
  826.     BrowseWin:=NIL;
  827.   END;
  828.  
  829.   Function BrowseInit: Boolean;
  830.   BEGIN
  831.     BrowseInit:=True;
  832.     New(BrowseWin, InitCustom(1,7,ScreenWidth,ScreenHeight,Cfg.Color[3],DefWindowOptions,16384));
  833.     If BrowseWin=Nil then
  834.     BEGIN
  835.       AskError(8,'Could not open browser:'+Long2Str(Maxavail),4);
  836.       BrowseInit:=False;
  837.     end;
  838.     BrowseCommands.AddCommand(ccUser1, 1, Word(256*75), 0);       { Left       }
  839.     BrowseCommands.AddCommand(ccUser2, 1, Word(256*77), 0);       { Right      }
  840.     BrowseCommands.AddCommand(ccUser3, 1, Word(256*83), 0);       { Delete     }
  841.     BrowseCommands.AddCommand(ccUser4, 1, Word(11875 ), 0);       { c          }
  842.     BrowseCommands.AddCommand(ccUser5, 1, Word(30464 ), 0);       { ctrl-Home  }
  843.     BrowseCommands.AddCommand(ccUser6, 1, Word(4709  ), 0);       { e          }
  844.     BrowseCommands.AddCommand(ccUser7, 1, Word(4978  ), 0);       { r          }
  845.   END;
  846.  
  847.   Function OpenMsgArea(Directory:String;MsgBaseType:Byte):Boolean;
  848.   VAR
  849.     MsgID : String;
  850.   BEGIN
  851.     OpenMsgArea:=True;
  852.     Case MSGBaseType of
  853.       0 : MsgID:='H'+LeftPadCh(JustName(Directory),'0',3)+AddBackSlash(JustPathName(Directory));
  854.       1 : MsgID:='F'+Directory;
  855.       2 : MsgID:='S'+Directory;
  856.       3 : MsgID:='E'+Directory;
  857.       4 : MsgID:='J'+Directory;
  858.     END;
  859.     If not OpenOrCreateMsgArea(Msg, MsgID) then
  860.     BEGIN
  861.       AskError(8,'Could not open message area',4);
  862.       OpenMsgArea:=False;
  863.       Exit;
  864.     END;
  865.   END;
  866.  
  867.   Function OpenArea(Directory:String;MsgBaseType:Byte):Boolean;
  868.   BEGIN
  869.     If not OpenMsgArea(Directory,MsgBaseType) then exit else OpenArea:=True;
  870.     MyWin(HeaderWin,1,1,80,6,3,'PopEd v'+ver,False);
  871. {   Msg^.SetMailType(mmtEchoMail); }
  872.     MsgNumber:=Msg^.GetLastRead(0);
  873.     OpenArea:=BrowseInit;
  874.   END;
  875.  
  876.   PROCEDURE CloseArea;
  877.   BEGIN
  878.     BrowseDispose;
  879.     Msg^.SetLastRead(0,MsgNumber);
  880.     KillWindow(HeaderWin);
  881.     CloseMsgArea(Msg);
  882.   END;
  883.  
  884.   Procedure NotFound;
  885.   VAR
  886.     t : Text;
  887.   BEGIN
  888.     If Msg^.GetMsgDisplayNum < Msg^.GetHighMsgNum then
  889.       Msg^.SeekNext
  890.     ELSE
  891.       Msg^.SeekPrior;
  892.     If not Msg^.SeekFound then
  893.     BEGIN
  894.       Assign(t,TmpName);
  895.       ReWrite(t);
  896.       WriteLn(T,'');
  897.       Close(t);
  898.       MsgNumber:=0;
  899.       Exit;
  900.     END;
  901.   END;
  902.  
  903.   Procedure LoadMessage;   {Use First Time}
  904.   VAR
  905.     TmpAdr : TFidoAddress;
  906.   BEGIN
  907.     Msg^.SeekFirst(MsgNumber);
  908.     If not Msg^.SeekFound then
  909.       NotFound;
  910.     If MsgNumber <> 0 then
  911.     BEGIN
  912.       Msg^.MsgStartUp;
  913.       Dump2File;
  914.       PopEdInfo^.OriginalSysopName:=Msg^.GetFrom;
  915.       PopEdInfo^.OriginalToSysopName:=Msg^.GetTo;
  916.       Msg^.GetOrig(TmpAdr);
  917.       PopEdInfo^.OriginalAddress:=(Address2Str(TmpAdr));
  918.       Msg^.GetDest(TmpAdr);
  919.       PopEdInfo^.OriginalToAddress:=(Address2Str(TmpAdr));
  920.       PopEdInfo^.OriginalSubject:=Msg^.GetSubj;
  921.     END;
  922.   END;
  923.  
  924.   Procedure EnterNewMsg;
  925.   VAR
  926.     GemMsgNumber : LongInt;
  927.   BEGIN
  928.     GemMsgNumber := MsgNumber;
  929.     EditHeader;
  930.     ProcessTemplate(0);
  931.     BrowseDispose;
  932.     EditMessage;
  933.     SaveMessage;
  934.     BrowseInit;
  935.     MsgNumber := GemMsgNumber;
  936.     LoadMessage;
  937.   END;
  938.  
  939.   Procedure EnterReplyMsg;
  940.   VAR
  941.     GemMsgNumber : LongInt;
  942.   BEGIN
  943.     GemMsgNumber := MsgNumber;
  944.     EditHeader;
  945.     ProcessTemplate(5);
  946.     BrowseDispose;
  947.     EditMessage;
  948.     SaveMessage;
  949.     BrowseInit;
  950.     MsgNumber := GemMsgNumber;
  951.     LoadMessage;
  952.   END;
  953.  
  954.  
  955.   Procedure NextMessage;
  956.   BEGIN
  957.     If MsgNumber < Msg^.GetHighMsgNum then
  958.     BEGIN
  959.       Msg^.SeekNext;
  960.       If not Msg^.SeekFound then
  961.         NotFound;
  962.       If MsgNumber <> 0 then
  963.       BEGIN
  964.         Msg^.MsgStartUp;
  965.         MsgNumber:=Msg^.GetMsgNum;
  966.         Dump2File;
  967.       END;
  968.     END;
  969.   END;
  970.  
  971.   Procedure PrevMessage;
  972.   BEGIN
  973.     Msg^.SeekPrior;
  974.     If not Msg^.SeekFound then
  975.       NotFound;
  976.     If MsgNumber <> 0 then
  977.     BEGIN
  978.       Msg^.MsgStartUp;
  979.       MsgNumber:=Msg^.GetMsgNum;
  980.       Dump2File;
  981.     END;
  982.   END;
  983.  
  984.   Procedure DeleteMessage;
  985.   BEGIN
  986.     Msg^.DeleteMsg;
  987.     PrevMessage;
  988.     NextMessage;
  989.   END;
  990.  
  991.   PROCEDURE BrowseText;
  992.   Var
  993.     Finished2 : Boolean;
  994.   BEGIN
  995.     Finished2 := False;
  996.     LoadMessage;
  997.     While not Finished2 do
  998.     BEGIN
  999.       ShowHeader;
  1000.       Case Browse(TmpName) of
  1001.         ccUser1 : If MsgNumber<>0 then PrevMessage;
  1002.         ccUser2 : If MsgNumber<>0 then NextMessage;
  1003.         ccUser3 : If MsgNumber<>0 then DeleteMessage;
  1004. {       ccUser4 : If MsgNumber<>0 then EditMessage; }
  1005.         ccUser4 : If MsgNumber<>0 then EditHeader;
  1006.         ccUser6 : If MsgNumber<>0 then EnterNewMsg;
  1007.         ccUser7 : If MsgNumber<>0 then EnterReplyMsg;
  1008.         ccUser5 : If MsgNumber<>0 then
  1009.                     BEGIN
  1010.                       MsgNumber:=1;
  1011.                       LoadMessage;
  1012.                     END;
  1013.       ELSE
  1014.         Finished2 := True;
  1015.       END;
  1016.     END;
  1017.   END;
  1018.  
  1019.  
  1020. {----------------------------------------------------------------------------}
  1021.  
  1022.   FUNCTION _GetPoPEdStr(VAR Buffer): String; far;
  1023.   VAR
  1024.     s   : STRING;
  1025.   BEGIN
  1026.     WITH TPOPEDArea(Buffer) DO
  1027.     BEGIN
  1028.       s:=Pad(Description,40)+' '+Pad(EchoNames[1],20)+' '+
  1029.         LeftPad(Long2Str(NumMsg),7)+LeftPad(Long2Str(NumMsg-LastRead),7);
  1030.     END;
  1031.     _GetPoPEdStr:=s;
  1032.   END;
  1033.  
  1034.   PROCEDURE _EditPoPEd(VAR Buffer; VAR Changed: Boolean; RecNum, MaxRec: LongInt); far;
  1035.   BEGIN
  1036.     If OpenArea(TPOPEDarea(Buffer).Directory,TPOPEDArea(Buffer).AreaType) then
  1037.     BEGIN
  1038.       If (MsgNumber>Msg^.GetHighMsgNum) or (MsgNumber<1) then MsgNumber:=1;
  1039.       Msg^.SeekFirst(MsgNumber);
  1040.       If Msg^.SeekFound then
  1041.       BEGIN
  1042.         Msg^.SeekNext;
  1043.         If MSG^.SeekFound then
  1044.           MsgNumber:=Msg^.GetMsgNum;
  1045.       END;
  1046.       BrowseText;
  1047.       TPOPEDarea(Buffer).NumMsg:=MSG^.NumberOfMsgs;
  1048.       TPOPEDarea(Buffer).LastRead:=MSG^.GetMsgDisplayNum;
  1049.       CloseArea;
  1050.     END;
  1051.     Changed := True;
  1052. {   Esr.Select;
  1053.     Esr.SetNextField(0);
  1054.     Esr.Draw;
  1055. }
  1056.   END;
  1057.  
  1058.   PROCEDURE _InitPoPEd(VAR Buffer); far;
  1059.   BEGIN
  1060. {   FillChar(Buffer,SizeOf(TMsgArea),0); }
  1061.   END;
  1062.  
  1063.   FUNCTION _IsGreaterPoPEd(VAR B1,B2): Boolean; far;
  1064.   BEGIN
  1065.     _IsGreaterPoPEd:=TPOPEDArea(B1).EchoNames[1]>TPOPEDArea(B2).EchoNames[1];
  1066.   END;
  1067.  
  1068.   PROCEDURE PoPEdPostEdit(Esr: EntryScreenPtr); far;
  1069.   BEGIN
  1070. {   IF (ESR^.CurrentFieldModified) THEN Save:=True;}
  1071.   END;
  1072.  
  1073.   PROCEDURE BrowseAreas;
  1074.   VAR
  1075.     p         : POINTER;
  1076.     ExitCode  : WORD;
  1077.  
  1078.     Procedure ScanForNewMsg;
  1079.     Var
  1080.       POPArea   : TMSGArea;
  1081.     BEGIN
  1082.       While Not EOF(f) do
  1083.       BEGIN
  1084.         NetRead(f,PopArea,false,false);
  1085.         PopEdArea^.Directory  := PopArea.Directory;
  1086.         PopEdArea^.EchoNames[1]  := PopArea.EchoNames[1];
  1087.         PopEdArea^.EchoNames[2]  := PopArea.EchoNames[2];
  1088.         PopEdArea^.EchoNames[3]  := PopArea.EchoNames[3];
  1089.         PopEdArea^.Origin     := PopArea.Origin;
  1090.         PopEdArea^.Pvt2EMail  := PopArea.Pvt2EMail;
  1091.         PopEdArea^.Description:= PopArea.Description;
  1092.         PopEdArea^.AreaType   := PopArea.AreaType;
  1093.         PopEdArea^.UsedAka    := PopArea.UsedAka;
  1094.         OpenMsgArea(PopEdArea^.Directory,PopEdArea^.AreaType);
  1095.         Msg^.SeekFirst(Msg^.GetLastRead(0));
  1096.         If not Msg^.SeekFound then
  1097.           NotFound;
  1098.         PopEdArea^.NumMsg:=Msg^.NumberOfMsgs;
  1099.         PopEdArea^.LastRead:=Msg^.GetMsgDisplayNum;
  1100.         CloseMsgArea(MSG);
  1101.         NetWrite(ff,POPEDArea^)
  1102.       END;
  1103.     END;
  1104.  
  1105.   BEGIN
  1106.     Deletefile(StartPath+TmpName2);
  1107.     NetOpenFile(ff,StartPath+TmpName2,SizeOf(TPOPEDArea),True);
  1108.     NetOpenFile(f,StartPath+PoPMsgAreaFileName,SizeOf(TMsgArea),True);
  1109.     ScanForNewMsg;
  1110.     NetCloseFile(f);
  1111.     Allowed:=10;
  1112.     BrowseRecords(ff,Popedarea^,ExitCode,'Message Areas',
  1113.                   Pad('Area',41)+Pad('Tag',21)+LeftPad('Msgs',7)+LeftPad('New',7),
  1114.                   _GetPoPEdStr,_EditPoPEd,_InitPoPEd,_IsGreaterPoPEd);
  1115. {   Esr.Done;}
  1116.     NetCloseFile(ff);
  1117.   END;
  1118.  
  1119.  
  1120.  
  1121.   PROCEDURE PopEdMain;
  1122.   BEGIN
  1123. {$IFNDEF PoPLite}
  1124. {   FreeUpMemory; }
  1125.     New(PopEdArea);
  1126.     New(PopEdInfo);
  1127.     BrowseAreas;
  1128.     Dispose(PopEdInfo);
  1129.     Dispose(PopEdArea);
  1130. {   InitialiseNodelist(cfg.NodeList,cfg.nodelisttyp); }
  1131. {$ELSE}
  1132.     AddLog('!','Not implemented in Portal of Power/Lite');
  1133. {$ENDIF}
  1134.   END;
  1135.  
  1136. END.
  1137.